<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>遍历操作</title>
</head>
<body>
 <ul>
     <li>0</li>
     <li>1</li>
     <li>2</li>
     <li>3</li>
 </ul>
<button id="btn">遍历</button>
</body>
<script src="js/jquery-3.3.1.min.js"></script>
<script>
    //方式一：传统方式
    $("#btn").click(function(){
        let lis = $("li");
        for(let i = 0 ; i < lis.length; i++) {
            alert(i + ":" + lis[i].innerHTML);
        }
    });
</script>
</html>